package com.bitcs.accesscontrol.controller;

import com.bitcs.accesscontrol.dao.entity.RequestVO;
import com.bitcs.accesscontrol.log.AccessLog;
import com.bitcs.accesscontrol.service.AccessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author GeChen
 * @Description
 * @date 2019/10/30 16:57
 */
@RestController
@RequestMapping("/api")
public class AccessController {
    @Autowired
    private AccessService accessService;

    /**
     * 判断是否有权限
     *
     * @param appId
     * @param type
     * @return
     */
    @RequestMapping("/getAccess")
    @AccessLog(operationName = "调用权限查询")
    public String getAccessByVO(@RequestParam String appId, @RequestParam String type) {
        RequestVO requestVO = new RequestVO();
        requestVO.setAppId(appId);
        requestVO.setType(type);
        return accessService.getAccessByVO(requestVO);
    }
}
